import request from './request'

export interface AuthLoginReq {
  username: string
  password: string
  captchaVerification?: string
  socialType?: number
  socialCode?: string
  socialState?: string
}

export interface AuthLoginResp {
  userId: number
  accessToken: string
  refreshToken: string
  expiresTime: string
}

/**
 * 使用账号密码登录
 * 仅该请求携带 tenant-id: 1
 */
export const authApi = {

  login(data: AuthLoginReq): Promise<AuthLoginResp> {
    return request.post('/system/auth/login', data)
  }

}